// 工厂函数：每次调用返回一个新的变量属性对象
const createVariableProperties = () => ({
    // 基本信息
    id: -1,
    name: 'VarName',
    monitor_device_id: -1,
    extra: {
        alias: '',
        dataType: 'int32',
        decimalPlaces: 0,
        conversionFactor: 1,
        data_type: 1,
        decimal: 1,
        unit: '',
        modulus: 0.0,
        content_value: '',
        formula: '',
        opc_var_path: '',
        offset: 0,
        // 报警属性
        alarm: {
            conditionOperator: '>',
            conditionValue: '',
            eventIdentifier: ''
        },
        // HJ212属性
        hj212: {
            signalType: '非模拟量',
            rangeUpper: '',
            rangeLower: '',
            alarmUpper: '',
            alarmLower: '',
            reportConfig: []
        },
        // 协议属性
        protocol: {
            type: 'general',
            general: {
                queryCommand: '',
                messageStart: '',
                valueStartByte: '',
                dataLength: ''
            },
            lt645: {
                ruleCategory: '电能',
                ruleId: '当前组合有功总电能'
            }
        },
        // CustomFrame
        frame: {
            tx_rule: ''
        },
        // RegTypeExValue
        regTypeEx: {
            DBNum: '',
            RegAddr: '',
            BitAddr: '',
            RegTypeEx: 0
        },
        // 非OPC协议相关配置
        general: {
            type: '',
            type_rw: 3, // 1读 2写 3读写
            address: '',
            isHex: true,
            addressUnit: ''
        }
    }
})

export default createVariableProperties